﻿<UserControl x:Class="SUMO.MediaBrowser.Controls.Adorners.Adorner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="400" Height="300" >
    <Grid x:Name="gridControl" SizeChanged="gridControl_SizeChanged" RenderTransformOrigin="0.5,0.5">
        <Grid.Resources>
            <Style TargetType="Thumb" x:Key="ThumbResizeStyle">
                <Setter Property="Cursor" Value="None" />
                <Setter Property="Margin" Value="-10" />
                <Setter Property="Width" Value="16" />
                <Setter Property="Height" Value="16" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Thumb">
                            <Rectangle Fill="Transparent" Width="16" Height="16" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style TargetType="Thumb" x:Key="ThumbResizeNoEdgeStyle">
                <Setter Property="Cursor" Value="None" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Thumb">
                            <Rectangle Fill="Transparent" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style TargetType="Thumb" x:Key="ThumbRotateStyle">
                <Setter Property="Cursor" Value="None" />
                <Setter Property="Margin" Value="-24" />
                <Setter Property="Width" Value="30" />
                <Setter Property="Height" Value="30" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Thumb">
                            <Rectangle Fill="Transparent" Width="30" Height="30" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
        <!--<Grid x:Name="gridTransformed" >-->
            <Grid.RowDefinitions>
                <RowDefinition Height="0"/>
                <RowDefinition/>
                <RowDefinition Height="0"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0"/>
                <ColumnDefinition/>
                <ColumnDefinition Width="0"/>
            </Grid.ColumnDefinitions>
            <Grid.RenderTransform>
                <TransformGroup>
                    <RotateTransform x:Name="trRotate" Angle="0" />
                    <TranslateTransform x:Name="trTranslate" X="100" Y="0" />
                </TransformGroup>
            </Grid.RenderTransform>
            <!-- adorner frame goes here -->
           

            <!--<Image Source="/TileMaster;component/Images/Hydrangeas.jpg" Stretch="Fill" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
               Grid.RowSpan="3" Grid.ColumnSpan="3"/>-->
            <Thumb x:Name="thumbMove" Grid.RowSpan="3" Grid.ColumnSpan="3" Margin="0" MouseMove="thumb_MouseMove" MouseLeftButtonUp="thumbMove_MouseLeftButtonUp"
                   DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted"
                   MouseEnter="thumb_MouseEnter" MouseLeave="thumb_MouseLeave" Cursor="None">
                <Thumb.Template>
                    <ControlTemplate TargetType="Thumb">
                        <Rectangle Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" Fill="Transparent" />
                    </ControlTemplate>
                </Thumb.Template>
            </Thumb>

            <Thumb x:Name="rotate00" Style="{StaticResource ThumbRotateStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" 
               DragStarted="rotate_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" 
               />

            <Thumb x:Name="rotate01" Style="{StaticResource ThumbRotateStyle}" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" 
               DragStarted="rotate_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" 
               />

            <Thumb x:Name="rotate10" Style="{StaticResource ThumbRotateStyle}" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top" 
               DragStarted="rotate_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" 
               />

            <Thumb x:Name="rotate11" Style="{StaticResource ThumbRotateStyle}" Grid.Column="2" Grid.Row="2"  HorizontalAlignment="Right" VerticalAlignment="Bottom" 
               DragStarted="rotate_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" 
               />


            <Thumb x:Name="resize00" Style="{StaticResource ThumbResizeStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" 
               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" 
               />
            <Thumb x:Name="resize10" Style="{StaticResource ThumbResizeStyle}" Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Top" 
               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" 
               />

            <Thumb x:Name="resize01" Style="{StaticResource ThumbResizeStyle}" Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" 
               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" 
               />

            <Thumb x:Name="resize11" Style="{StaticResource ThumbResizeStyle}" Grid.Column="2" Grid.Row="2"  HorizontalAlignment="Right" VerticalAlignment="Bottom" 
               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" 
               />


            <Thumb x:Name="resizeTop" Style="{StaticResource ThumbResizeNoEdgeStyle}" HorizontalAlignment="Stretch" VerticalAlignment="Top" 
               Margin="6,-10" Height="16" Grid.ColumnSpan="3" Grid.RowSpan="3"
               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" 
               />

            <Thumb x:Name="resizeBottom" Style="{StaticResource ThumbResizeNoEdgeStyle}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" 
               Margin="6,-10" Height="16" Grid.ColumnSpan="3" Grid.RowSpan="3"
               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" 
               />

            <Thumb x:Name="resizeLeft" Style="{StaticResource ThumbResizeNoEdgeStyle}" HorizontalAlignment="Left" VerticalAlignment="Stretch" 
               Margin="-10,6" Width="16" Grid.ColumnSpan="3" Grid.RowSpan="3"
               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" 
               />

            <Thumb x:Name="resizeRight" Style="{StaticResource ThumbResizeNoEdgeStyle}" HorizontalAlignment="Right" VerticalAlignment="Stretch" 
               Margin="-10,6" Width="16" Grid.ColumnSpan="3" Grid.RowSpan="3"
               DragStarted="thumb_DragStarted" DragCompleted="thumb_DragCompleted" 
               MouseEnter="thumb_MouseEnter" MouseMove="thumb_MouseMove" MouseLeave="thumb_MouseLeave" 
               />
<!--        </Grid>
        <TextBlock Grid.Row="1" Height="203" HorizontalAlignment="Left" Margin="-82,35,0,0" Name="info" Visibility="Collapsed"
                    Text="TextBlock" VerticalAlignment="Top" Width="336" IsHitTestVisible="False" Foreground="White"
                    Grid.ColumnSpan="2" />-->
    </Grid>
</UserControl>
